<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script src="./js/angular-1.5.8/angular.js"></script>
</head>
<body ng-app="mainApp">
<div ng-controller="controller1">
    <input type="text" ng-model="txt"/><br/>
    <input type="text" ng-model="txt"/><br/>
</div>
<hr>
<div ng-controller="controller2">
    <input type="text" ng-model="txt"/><br/>
    <input type="text" ng-model="txt"/><br/>
</div>
</body>
<script>
    var module = angular.module('mainApp',[])
    //如果代码只是这么写，等价于不写na-app的名字也不写script代码
    module.controller('controller1',function($scope){
        $scope.txt = '请输入数据';
    });
    module.controller('controller2',function($scope){

    });
    //不应该将所有的功能放到主模板中
    //理论上是说将功能放在子模块中
</script>
</html>